<template>
  <my-modal ref="modal" title="会员码">
    <view class="container">
      <view class="is-flex-col flex-center">
        <image v-if="qrcode" :src="qrcode" style="width: 130px" mode="widthFix"></image>
        <view v-else class="primary-grey-text mt-5 fs-xs" style="color: #6a78a3">会员码生成失败</view>
      </view>
    </view>
  </my-modal>
</template>

<script>
export default {
  props: {
    // 会员码
    qrcode: {
      type: String,
      default: null
    }
  },
  data() {
    return {}
  },
  methods: {
    open(param) {
      this.$refs.modal.open({ showClose: this.$format(param, 'showClose', true) })
    },
    close() {
      this.$emit('afterModalClose')
      this.$refs.modal.close()
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.tips {
  padding: 10px 10px;
  font-size: $font-size-xs;
  background: #252940;
  margin-bottom: 5px;
}
</style>
